package cn.kgc.springbootdemo.util;

import cn.kgc.springbootdemo.config.minio.MinioProperties;
import cn.kgc.springbootdemo.constant.MinioConstant;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * <h3>jiayou</h3>
 * <p>Minio路径工具</p>
 *
 * @author : DongZeJian
 * @date : 2020-09-02 10:22
 **/
@Component
public class MinioURLUtils {

    @Resource
    private MinioProperties minioProperties;

    /**
     * 获取文件绝对路径
     *
     * @param fileName 文件名称
     * @return 绝对路径
     */
    public String getMinioURl(String fileName) {
        return minioProperties.getUrl() + MinioConstant.DEMO + fileName;
    }
}
